<?php
/**
 * 主页
 */
namespace  app\index\controller;

use  app\index\model\BannerItem  as Bi;
use  app\index\model\Link  as L;
use  app\index\model\Contact as Ct;


class InteractionController extends BaseController{
    private $foot;
    public function _initialize(){
        $this->foot=$this->foot();
    }

    //列表
    public function index(){
        //banners
    	$banners=Bi::all(function($query){
    		$query->where('banner_id','eq',2)->where('status','eq',1)->order('id','asc');
    	});
    	//search
    	$search=L::where('status','eq',5)->order('id','asc')->limit(5)->select();

    	//all
    	$alls=L::where('status','eq',5)->order('id','asc')->select();
    	//官方微信
    	$wx=Ct::field('pic,sm_pic')->where('status','eq',1)->find();
    	//var_dump($wx);die();
    	//var_dump($alls);
    	$this->assign([
    		'banners'=>$banners,
    		'search'=>$search,
    		'alls'=>$alls,
    		'wx'=>$wx,
            'foot'=>$this->foot
    	]);
        return $this->fetch('interaction/index');
    }

}
